import request from '@/utils/request'

// 查询产品列表
export function listProduct(query) {
  return request({
    url: '/biz/product/list',
    method: 'get',
    params: query
  })
}

// 查询产品详细
export function getProduct(id) {
  return request({
    url: '/biz/product/' + id,
    method: 'get'
  })
}

// 新增产品
export function addProduct(data) {
  return request({
    url: '/biz/product',
    method: 'post',
    data: data
  })
}

// 修改产品
export function updateProduct(data) {
  return request({
    url: '/biz/product',
    method: 'put',
    data: data
  })
}

// 发布产品
export function publishProduct(id) {
  return request({
    url: '/biz/product/publish/' + id,
    method: 'put',
    data: {}
  })
}

// 取消发布产品
export function cancelPublishProduct(id) {
  return request({
    url: '/biz/product/cancelPublish/' + id,
    method: 'put',
    data: {}
  })
}

// 删除产品
export function delProduct(id) {
  return request({
    url: '/biz/product/' + id,
    method: 'delete'
  })
}

// 导出产品
export function exportProduct(query) {
  return request({
    url: '/biz/product/export',
    method: 'get',
    params: query
  })
}

// 查询所有产品信息
export function selectProductList(query) {
  return request({
    url: '/biz/product/selectProductList',
    method: 'get',
	params: query
  })
}
// 产品选择树
export function productTreeSelect(query) {
  return request({
    url: '/biz/product/treeSelect',
    method: 'get',
    params: query
  })
}
